package com.lening.provider.controller.ComplaintAndAdvice;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseController;
import com.lening.provider.dto.ComplaintAndAdvice.ComplaSuggestionMainTableDTO;
import com.lening.provider.po.ComplaintAndAdvice.ComplaSuggestionMainTablePO;
import com.lening.provider.po.InternalWorkOrder.ErnalWorkOrderMainTablePO;
import com.lening.provider.service.ComplaintAndAdvice.ComplaSubtableService;
import com.lening.provider.service.ComplaintAndAdvice.ComplaSuggestionMainTableService;
import com.lening.provider.service.ComplaintAndAdvice.ComplaTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient;

import javax.annotation.Resource;

/**
 * @author 刘政华
 * @datetime 2024/6/4 10:12
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("complaSuggestionMainTables")
public class ComplaSuggestionMainTableController extends BaseController<ComplaSuggestionMainTablePO, ComplaSuggestionMainTableDTO, ComplaSuggestionMainTableService> {

    @Autowired(required = false)
    private WebClient webClient;

    @Resource
    private ComplaSuggestionMainTableService complaSuggestionMainTableService;

    @Resource
    private ComplaSubtableService complaSubtableService;

    @Resource
    private ComplaTypeService complaTypeService;

    @Override
    public Page<?> page(ComplaSuggestionMainTableDTO complaSuggestionMainTableDTO) {
        return complaSuggestionMainTableService.complaList(complaSuggestionMainTableDTO);
    }

    @GetMapping("/count")//待处理投诉
    public long getCount() {
        return complaSuggestionMainTableService.count();
    }

}
